package com.mhkj.base.itemInfo.phase.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.mhkj.base.itemInfo.phase.entity.Phase;
import com.mics.core.system.base.repository.BaseRepository;

public interface PhaseDao extends BaseRepository<Phase>{
	/**
	 * 通过项目id查询非组团期区
	 */
	@Query("select t from Phase t where t.item.id = :itemId and t.group.id is null")
	List<Phase> findPhaseByItemId(@Param("itemId")Long itemId);

	/**
	 * 通过组团id查询组团下期区
	 */
	@Query("select t from Phase t where t.group.id = :groupId")
	List<Phase> findPhaseByGroupId(@Param("groupId")Long groupId);
}
